<!--
  ~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License"); you may not
  ~ use this file except in compliance with the License. You may obtain a copy
  ~ of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software distributed
  ~ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  ~ CONDITIONS OF ANY KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations under the License.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>Event Stream Manager - User Guide</title>

    <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all"/>
</head>
<body>
<h1>Event Stream Manager</h1>

<h2>Configuring Event Streams</h2>

<p>Event Streams are another main part in CEP. All the processes are happens based on streams. Here
   Event streams needs to defined as WSO2Event Stream Definition. All the streams which are created
   stored in the registry (governance) of the CEP.</p>

<h3>Configuring through the Management Console UI</h3>

<p>1. Start the CEP, log in to its management console, select <strong>Event Streams</strong> and
   click <strong>Add Event Stream</strong>.</p>

<p>2. Enter details in the form that appears and click the <strong>Add Event Stream</strong> button
   at the end of the form. For example</p>

<p><br/><img src="../images/eventStreamUi.png" alt="Create Event Stream"/></p>

<p>Here, fill the necessary fields according to the stream definition that you want to create.</p>

<div>3. Finally, Click the Add Event Stream button to add the stream definition to the registry.
     Then <strong>Available Event Stream</strong> page will open. To delete event stream, click the
    <strong>Delete</strong> button.
</div>
<p>To create an event builder or execution plan it is mandatory to create necessary event streams
   before hand.</p>
<br/>

<p>Other than the server UI, you can also define the stream definition using a config file which is
   in the &lt;CEP_HOME&gt;/repository/conf/stream-manager-config.xml. But this file used to create
   streams only in the server start-up (This file is not hot deploy-able). Please see the below
   syntax</p>

<pre>&lt;streamManagerConfiguration xmlns="http://wso2.org/carbon/streammanager"&gt;
    &lt;streamDefinition name="org.wso2.sample.stock.quote.basic" version="1.0.0"&gt;
        &lt;payloadData&gt;
            &lt;property name="price" type="DOUBLE"/&gt;
            &lt;property name="symbol" type="STRING"/&gt;
        &lt;/payloadData&gt;
    &lt;/streamDefinition&gt;
    &lt;streamDefinition name="org.wso2.sample.twitter.feed" version="1.0.0"&gt;
        &lt;payloadData&gt;
            &lt;property name="company" type="STRING"/&gt;
            &lt;property name="wordCount" type="INT"/&gt;
        &lt;/payloadData&gt;
    &lt;/streamDefinition&gt;
    &lt;streamDefinition name="org.wso2.sample.predicted.stock.quotes" version="1.0.0"&gt;
        &lt;payloadData&gt;
            &lt;property name="company" type="STRING"/&gt;
            &lt;property name="amount" type="DOUBLE"/&gt;
            &lt;property name="words" type="LONG"/&gt;
        &lt;/payloadData&gt;
    &lt;/streamDefinition&gt;
    &lt;streamDefinition name="twitterFeed" version="1.0.0"&gt;
        &lt;payloadData&gt;
            &lt;property name="company" type="STRING"/&gt;
            &lt;property name="wordCount" type="INT"/&gt;
        &lt;/payloadData&gt;
    &lt;/streamDefinition&gt;

&lt;/streamManagerConfiguration&gt; </pre>


</body>
</html>

